package com.ruoyi.price.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.QueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.price.domain.TbFormulaWidget;
import com.ruoyi.price.domain.TbFormulaWidgetAttr;
import com.ruoyi.price.mapper.TbFormulaWidgetAttrMapper;
import com.ruoyi.price.mapper.TbFormulaWidgetMapper;
import com.ruoyi.price.service.ITbFormulaWidgetAttrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

import java.util.List;

/**
 * 公式控件属性信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-16
 */
@Service
public class TbFormulaWidgetAttrServiceImpl extends ServiceImpl<TbFormulaWidgetAttrMapper, TbFormulaWidgetAttr> implements ITbFormulaWidgetAttrService
{

    @Override
    public List<TbFormulaWidgetAttr> listByFormulaIdAndWidgetId(Long formulaId, Long widgetId) {
        return list(new QueryWrapper<TbFormulaWidgetAttr>()
                .lambda().eq(TbFormulaWidgetAttr::getFormualId,formulaId)
                .eq(TbFormulaWidgetAttr::getWidgetId,widgetId));
    }

    @Override
    public boolean removeByFormulaId(Long formulaId) {
        return remove(new QueryWrapper<TbFormulaWidgetAttr>().lambda().eq(TbFormulaWidgetAttr::getFormualId,formulaId));
    }

    @Override
    public boolean removeByFormulaIds(List<String> formulaIdList) {
        return remove(new QueryWrapper<TbFormulaWidgetAttr>().lambda().in(TbFormulaWidgetAttr::getFormualId,formulaIdList));
    }
}
